
{% extends "admin/base_site.html" %}

{% block extrahead %}
    {{ block.super }}
    <!-- 这里添加你的自定义JavaScript代码 -->
    <script type="text/javascript">
        // 你的JavaScript代码
        function downloadFile(url, filename) {
            var xhr = new XMLHttpRequest();
            xhr.open('GET', url, true);
            xhr.responseType = 'blob';
            xhr.onload = function() {
                if (this.status === 200) {
                    var url = window.URL.createObjectURL(this.response);
                    var a = document.createElement("a");
                    a.href = url;
                    a.download = filename; 
                    document.body.appendChild(a);
                    a.click();
                    document.body.removeChild(a);
                    window.URL.revokeObjectURL(url);
                }
            };
            xhr.send();
        }
    </script>
{% endblock %}